package com.rem.hutool.my4IO;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.file.FileAppender;

import java.io.File;

/**
 * 文件追加
 *
 * @author Rem
 * @date 2020-08-20
 */

public class FileAppenderDemo {

    public static void main(String[] args) {
        File file = FileUtil.file("../../src/main/resources/static/name4.txt");
        FileAppender appender = new FileAppender(file, 16, true);
        appender.append("\n");
        appender.append("123");
        appender.append("abc");
        appender.append("xyz");

        appender.flush();
        String s = appender.toString();
        System.err.println(s.length());
    }


}
